import { setToken, delToken } from '@/utils/storage'
export default {
  namespaced: true,
  state: {
    token: '',
    username: '',
    userId: ''
  },
  getters: {
  },
  mutations: {
    getToken (state, payload) {
      console.log(payload)
      state.username = payload.userName
      state.token = payload.token
      setToken(payload.token)
      state.userId = payload.userId
    },
    logout (state) {
      console.log(1)
      state.token = ''
      delToken()
    }
  },
  actions: {
  }
}
